 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKIotcloudgateway/IotcloudgatewayModel.h>

@implementation OssSpec
-(id) initWithOss_ak:(NSString*) oss_ak
      oss_sk:(NSString*)oss_sk
      oss_region:(NSString*)oss_region
      oss_endpoint:(NSString*)oss_endpoint
      oss_bucket:(NSString*)oss_bucket { 
     self.oss_ak = oss_ak;               
     self.oss_sk = oss_sk;               
     self.oss_region = oss_region;               
     self.oss_endpoint = oss_endpoint;               
     self.oss_bucket = oss_bucket;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self oss_ak])
    {
        [result setValue:[self oss_ak] forKey:@"oss_ak"];
    }
    if([self oss_sk])
    {
        [result setValue:[self oss_sk] forKey:@"oss_sk"];
    }
    if([self oss_region])
    {
        [result setValue:[self oss_region] forKey:@"oss_region"];
    }
    if([self oss_endpoint])
    {
        [result setValue:[self oss_endpoint] forKey:@"oss_endpoint"];
    }
    if([self oss_bucket])
    {
        [result setValue:[self oss_bucket] forKey:@"oss_bucket"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.oss_ak = [dictionary objectForKey:@"oss_ak"];
    self.oss_sk = [dictionary objectForKey:@"oss_sk"];
    self.oss_region = [dictionary objectForKey:@"oss_region"];
    self.oss_endpoint = [dictionary objectForKey:@"oss_endpoint"];
    self.oss_bucket = [dictionary objectForKey:@"oss_bucket"];
    return self;
}
 @end
@implementation DwAuthSpec
-(id) initWithProductKey:(NSString*) productKey
      deviceIdent:(NSString*)deviceIdent
      deviceSecret:(NSString*)deviceSecret { 
     self.productKey = productKey;               
     self.deviceIdent = deviceIdent;               
     self.deviceSecret = deviceSecret;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self productKey])
    {
        [result setValue:[self productKey] forKey:@"productKey"];
    }
    if([self deviceIdent])
    {
        [result setValue:[self deviceIdent] forKey:@"deviceIdent"];
    }
    if([self deviceSecret])
    {
        [result setValue:[self deviceSecret] forKey:@"deviceSecret"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.productKey = [dictionary objectForKey:@"productKey"];
    self.deviceIdent = [dictionary objectForKey:@"deviceIdent"];
    self.deviceSecret = [dictionary objectForKey:@"deviceSecret"];
    return self;
}
 @end
@implementation ReplicaSpec
-(id) initWithRsname:(NSString*) rsname
      replica:(NSNumber*)replica { 
     self.rsname = rsname;               
     self.replica = replica;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self rsname])
    {
        [result setValue:[self rsname] forKey:@"rsname"];
    }
    if([self replica])
    {
        [result setValue:[self replica] forKey:@"replica"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.rsname = [dictionary objectForKey:@"rsname"];
    self.replica = [dictionary objectForKey:@"replica"];
    return self;
}
 @end
@implementation DeviceControlSpec
-(id) initWithRequest_id:(NSString*) request_id
      peers:(NSString*)peers
      br_msg:(NSString*)br_msg { 
     self.request_id = request_id;               
     self.peers = peers;               
     self.br_msg = br_msg;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self request_id])
    {
        [result setValue:[self request_id] forKey:@"request_id"];
    }
    if([self peers])
    {
        [result setValue:[self peers] forKey:@"peers"];
    }
    if([self br_msg])
    {
        [result setValue:[self br_msg] forKey:@"br_msg"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.request_id = [dictionary objectForKey:@"request_id"];
    self.peers = [dictionary objectForKey:@"peers"];
    self.br_msg = [dictionary objectForKey:@"br_msg"];
    return self;
}
 @end
@implementation Instance
-(id) initWithInstanceId:(NSString*) instanceId
      instanceName:(NSString*)instanceName
      instanceVersion:(NSString*)instanceVersion
      instanceRegion:(NSString*)instanceRegion
      instanceStatus:(NSString*)instanceStatus
      instanceFlavor:(NSString*)instanceFlavor
      azId:(NSString*)azId
      vpcId:(NSString*)vpcId
      subnetId:(NSString*)subnetId
      exposedDomain:(NSString*)exposedDomain
      replica:(NSNumber*)replica
      cloudstorage:(NSNumber*)cloudstorage
      serviceConfig:(NSString*)serviceConfig
      createTime:(NSString*)createTime
      gw_dev_id:(NSString*)gw_dev_id
      gw_dev_num:(NSNumber*)gw_dev_num
      chargeType:(NSNumber*)chargeType
      chargeExpired:(NSString*)chargeExpired { 
     self.instanceId = instanceId;               
     self.instanceName = instanceName;               
     self.instanceVersion = instanceVersion;               
     self.instanceRegion = instanceRegion;               
     self.instanceStatus = instanceStatus;               
     self.instanceFlavor = instanceFlavor;               
     self.azId = azId;               
     self.vpcId = vpcId;               
     self.subnetId = subnetId;               
     self.exposedDomain = exposedDomain;               
     self.replica = replica;               
     self.cloudstorage = cloudstorage;               
     self.serviceConfig = serviceConfig;               
     self.createTime = createTime;               
     self.gw_dev_id = gw_dev_id;               
     self.gw_dev_num = gw_dev_num;               
     self.chargeType = chargeType;               
     self.chargeExpired = chargeExpired;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self instanceVersion])
    {
        [result setValue:[self instanceVersion] forKey:@"instanceVersion"];
    }
    if([self instanceRegion])
    {
        [result setValue:[self instanceRegion] forKey:@"instanceRegion"];
    }
    if([self instanceStatus])
    {
        [result setValue:[self instanceStatus] forKey:@"instanceStatus"];
    }
    if([self instanceFlavor])
    {
        [result setValue:[self instanceFlavor] forKey:@"instanceFlavor"];
    }
    if([self azId])
    {
        [result setValue:[self azId] forKey:@"azId"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self exposedDomain])
    {
        [result setValue:[self exposedDomain] forKey:@"exposedDomain"];
    }
    if([self replica])
    {
        [result setValue:[self replica] forKey:@"replica"];
    }
    if([self cloudstorage])
    {
        [result setValue:[self cloudstorage] forKey:@"cloudstorage"];
    }
    if([self serviceConfig])
    {
        [result setValue:[self serviceConfig] forKey:@"serviceConfig"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self gw_dev_id])
    {
        [result setValue:[self gw_dev_id] forKey:@"gw_dev_id"];
    }
    if([self gw_dev_num])
    {
        [result setValue:[self gw_dev_num] forKey:@"gw_dev_num"];
    }
    if([self chargeType])
    {
        [result setValue:[self chargeType] forKey:@"chargeType"];
    }
    if([self chargeExpired])
    {
        [result setValue:[self chargeExpired] forKey:@"chargeExpired"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.instanceVersion = [dictionary objectForKey:@"instanceVersion"];
    self.instanceRegion = [dictionary objectForKey:@"instanceRegion"];
    self.instanceStatus = [dictionary objectForKey:@"instanceStatus"];
    self.instanceFlavor = [dictionary objectForKey:@"instanceFlavor"];
    self.azId = [dictionary objectForKey:@"azId"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.exposedDomain = [dictionary objectForKey:@"exposedDomain"];
    self.replica = [dictionary objectForKey:@"replica"];
    self.cloudstorage = [dictionary objectForKey:@"cloudstorage"];
    self.serviceConfig = [dictionary objectForKey:@"serviceConfig"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.gw_dev_id = [dictionary objectForKey:@"gw_dev_id"];
    self.gw_dev_num = [dictionary objectForKey:@"gw_dev_num"];
    self.chargeType = [dictionary objectForKey:@"chargeType"];
    self.chargeExpired = [dictionary objectForKey:@"chargeExpired"];
    return self;
}
 @end
@implementation Resource
-(id) initWithResourceId:(NSString*) resourceId
      resourceName:(NSString*)resourceName { 
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    return self;
}
 @end
@implementation NewInstanceSpec
-(id) initWithAzId:(NSArray<NSString*>*) azId
      az1flavor:(NSString*)az1flavor
      az1replica:(NSNumber*)az1replica
      az1storagesize:(NSNumber*)az1storagesize
      az2flavor:(NSString*)az2flavor
      az2replica:(NSNumber*)az2replica
      az2storagesize:(NSNumber*)az2storagesize { 
     self.azId = azId;               
     self.az1flavor = az1flavor;               
     self.az1replica = az1replica;               
     self.az1storagesize = az1storagesize;               
     self.az2flavor = az2flavor;               
     self.az2replica = az2replica;               
     self.az2storagesize = az2storagesize;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self azId])
    {
        [result setValue:[self azId] forKey:@"azId"];
    }
    if([self az1flavor])
    {
        [result setValue:[self az1flavor] forKey:@"az1flavor"];
    }
    if([self az1replica])
    {
        [result setValue:[self az1replica] forKey:@"az1replica"];
    }
    if([self az1storagesize])
    {
        [result setValue:[self az1storagesize] forKey:@"az1storagesize"];
    }
    if([self az2flavor])
    {
        [result setValue:[self az2flavor] forKey:@"az2flavor"];
    }
    if([self az2replica])
    {
        [result setValue:[self az2replica] forKey:@"az2replica"];
    }
    if([self az2storagesize])
    {
        [result setValue:[self az2storagesize] forKey:@"az2storagesize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.azId = [dictionary objectForKey:@"azId"];
    self.az1flavor = [dictionary objectForKey:@"az1flavor"];
    self.az1replica = [dictionary objectForKey:@"az1replica"];
    self.az1storagesize = [dictionary objectForKey:@"az1storagesize"];
    self.az2flavor = [dictionary objectForKey:@"az2flavor"];
    self.az2replica = [dictionary objectForKey:@"az2replica"];
    self.az2storagesize = [dictionary objectForKey:@"az2storagesize"];
    return self;
}
 @end
@implementation Erpinstance
-(id) initWithUserPin:(NSString*) userPin
      instanceId:(NSString*)instanceId
      instanceName:(NSString*)instanceName
      instanceVersion:(NSString*)instanceVersion
      instanceRegion:(NSString*)instanceRegion
      instanceStatus:(NSString*)instanceStatus
      instanceFlavor:(NSString*)instanceFlavor
      azId:(NSString*)azId
      vpcId:(NSString*)vpcId
      subnetId:(NSString*)subnetId
      exposedDomain:(NSString*)exposedDomain
      replica:(NSNumber*)replica
      cloudstorage:(NSNumber*)cloudstorage
      serviceConfig:(NSString*)serviceConfig
      createTime:(NSString*)createTime
      gw_dev_id:(NSString*)gw_dev_id
      gw_dev_num:(NSNumber*)gw_dev_num
      chargeType:(NSNumber*)chargeType
      chargeExpired:(NSString*)chargeExpired
      is_deleted:(NSNumber*)is_deleted { 
     self.userPin = userPin;               
     self.instanceId = instanceId;               
     self.instanceName = instanceName;               
     self.instanceVersion = instanceVersion;               
     self.instanceRegion = instanceRegion;               
     self.instanceStatus = instanceStatus;               
     self.instanceFlavor = instanceFlavor;               
     self.azId = azId;               
     self.vpcId = vpcId;               
     self.subnetId = subnetId;               
     self.exposedDomain = exposedDomain;               
     self.replica = replica;               
     self.cloudstorage = cloudstorage;               
     self.serviceConfig = serviceConfig;               
     self.createTime = createTime;               
     self.gw_dev_id = gw_dev_id;               
     self.gw_dev_num = gw_dev_num;               
     self.chargeType = chargeType;               
     self.chargeExpired = chargeExpired;               
     self.is_deleted = is_deleted;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self userPin])
    {
        [result setValue:[self userPin] forKey:@"userPin"];
    }
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self instanceVersion])
    {
        [result setValue:[self instanceVersion] forKey:@"instanceVersion"];
    }
    if([self instanceRegion])
    {
        [result setValue:[self instanceRegion] forKey:@"instanceRegion"];
    }
    if([self instanceStatus])
    {
        [result setValue:[self instanceStatus] forKey:@"instanceStatus"];
    }
    if([self instanceFlavor])
    {
        [result setValue:[self instanceFlavor] forKey:@"instanceFlavor"];
    }
    if([self azId])
    {
        [result setValue:[self azId] forKey:@"azId"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self exposedDomain])
    {
        [result setValue:[self exposedDomain] forKey:@"exposedDomain"];
    }
    if([self replica])
    {
        [result setValue:[self replica] forKey:@"replica"];
    }
    if([self cloudstorage])
    {
        [result setValue:[self cloudstorage] forKey:@"cloudstorage"];
    }
    if([self serviceConfig])
    {
        [result setValue:[self serviceConfig] forKey:@"serviceConfig"];
    }
    if([self createTime])
    {
        [result setValue:[self createTime] forKey:@"createTime"];
    }
    if([self gw_dev_id])
    {
        [result setValue:[self gw_dev_id] forKey:@"gw_dev_id"];
    }
    if([self gw_dev_num])
    {
        [result setValue:[self gw_dev_num] forKey:@"gw_dev_num"];
    }
    if([self chargeType])
    {
        [result setValue:[self chargeType] forKey:@"chargeType"];
    }
    if([self chargeExpired])
    {
        [result setValue:[self chargeExpired] forKey:@"chargeExpired"];
    }
    if([self is_deleted])
    {
        [result setValue:[self is_deleted] forKey:@"is_deleted"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.userPin = [dictionary objectForKey:@"userPin"];
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.instanceVersion = [dictionary objectForKey:@"instanceVersion"];
    self.instanceRegion = [dictionary objectForKey:@"instanceRegion"];
    self.instanceStatus = [dictionary objectForKey:@"instanceStatus"];
    self.instanceFlavor = [dictionary objectForKey:@"instanceFlavor"];
    self.azId = [dictionary objectForKey:@"azId"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.exposedDomain = [dictionary objectForKey:@"exposedDomain"];
    self.replica = [dictionary objectForKey:@"replica"];
    self.cloudstorage = [dictionary objectForKey:@"cloudstorage"];
    self.serviceConfig = [dictionary objectForKey:@"serviceConfig"];
    self.createTime = [dictionary objectForKey:@"createTime"];
    self.gw_dev_id = [dictionary objectForKey:@"gw_dev_id"];
    self.gw_dev_num = [dictionary objectForKey:@"gw_dev_num"];
    self.chargeType = [dictionary objectForKey:@"chargeType"];
    self.chargeExpired = [dictionary objectForKey:@"chargeExpired"];
    self.is_deleted = [dictionary objectForKey:@"is_deleted"];
    return self;
}
 @end
@implementation FlavorSpec
-(id) initWithRsname:(NSString*) rsname
      flavor:(NSString*)flavor { 
     self.rsname = rsname;               
     self.flavor = flavor;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self rsname])
    {
        [result setValue:[self rsname] forKey:@"rsname"];
    }
    if([self flavor])
    {
        [result setValue:[self flavor] forKey:@"flavor"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.rsname = [dictionary objectForKey:@"rsname"];
    self.flavor = [dictionary objectForKey:@"flavor"];
    return self;
}
 @end
@implementation CloudstorageSpec
-(id) initWithRsname:(NSString*) rsname
      size:(NSNumber*)size { 
     self.rsname = rsname;               
     self.size = size;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self rsname])
    {
        [result setValue:[self rsname] forKey:@"rsname"];
    }
    if([self size])
    {
        [result setValue:[self size] forKey:@"size"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.rsname = [dictionary objectForKey:@"rsname"];
    self.size = [dictionary objectForKey:@"size"];
    return self;
}
 @end
@implementation InstanceSpec
-(id) initWithInstanceName:(NSString*) instanceName
      instanceVersion:(NSString*)instanceVersion
      serviceName:(NSString*)serviceName
      actionName:(NSString*)actionName
      vpcId:(NSString*)vpcId
      subnetId:(NSString*)subnetId
      azId:(NSArray<NSString*>*)azId
      sourceType:(NSString*)sourceType
      az1flavor:(NSString*)az1flavor
      az1replica:(NSNumber*)az1replica
      az1storagesize:(NSNumber*)az1storagesize
      az2flavor:(NSString*)az2flavor
      az2replica:(NSNumber*)az2replica
      az2storagesize:(NSNumber*)az2storagesize { 
     self.instanceName = instanceName;               
     self.instanceVersion = instanceVersion;               
     self.serviceName = serviceName;               
     self.actionName = actionName;               
     self.vpcId = vpcId;               
     self.subnetId = subnetId;               
     self.azId = azId;               
     self.sourceType = sourceType;               
     self.az1flavor = az1flavor;               
     self.az1replica = az1replica;               
     self.az1storagesize = az1storagesize;               
     self.az2flavor = az2flavor;               
     self.az2replica = az2replica;               
     self.az2storagesize = az2storagesize;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self instanceVersion])
    {
        [result setValue:[self instanceVersion] forKey:@"instanceVersion"];
    }
    if([self serviceName])
    {
        [result setValue:[self serviceName] forKey:@"serviceName"];
    }
    if([self actionName])
    {
        [result setValue:[self actionName] forKey:@"actionName"];
    }
    if([self vpcId])
    {
        [result setValue:[self vpcId] forKey:@"vpcId"];
    }
    if([self subnetId])
    {
        [result setValue:[self subnetId] forKey:@"subnetId"];
    }
    if([self azId])
    {
        [result setValue:[self azId] forKey:@"azId"];
    }
    if([self sourceType])
    {
        [result setValue:[self sourceType] forKey:@"sourceType"];
    }
    if([self az1flavor])
    {
        [result setValue:[self az1flavor] forKey:@"az1flavor"];
    }
    if([self az1replica])
    {
        [result setValue:[self az1replica] forKey:@"az1replica"];
    }
    if([self az1storagesize])
    {
        [result setValue:[self az1storagesize] forKey:@"az1storagesize"];
    }
    if([self az2flavor])
    {
        [result setValue:[self az2flavor] forKey:@"az2flavor"];
    }
    if([self az2replica])
    {
        [result setValue:[self az2replica] forKey:@"az2replica"];
    }
    if([self az2storagesize])
    {
        [result setValue:[self az2storagesize] forKey:@"az2storagesize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.instanceVersion = [dictionary objectForKey:@"instanceVersion"];
    self.serviceName = [dictionary objectForKey:@"serviceName"];
    self.actionName = [dictionary objectForKey:@"actionName"];
    self.vpcId = [dictionary objectForKey:@"vpcId"];
    self.subnetId = [dictionary objectForKey:@"subnetId"];
    self.azId = [dictionary objectForKey:@"azId"];
    self.sourceType = [dictionary objectForKey:@"sourceType"];
    self.az1flavor = [dictionary objectForKey:@"az1flavor"];
    self.az1replica = [dictionary objectForKey:@"az1replica"];
    self.az1storagesize = [dictionary objectForKey:@"az1storagesize"];
    self.az2flavor = [dictionary objectForKey:@"az2flavor"];
    self.az2replica = [dictionary objectForKey:@"az2replica"];
    self.az2storagesize = [dictionary objectForKey:@"az2storagesize"];
    return self;
}
 @end
@implementation InstanceConfig
-(id) initWithServiceId:(NSString*) serviceId
      productKey:(NSString*)productKey
      productSecret:(NSString*)productSecret
      protocol:(NSString*)protocol
      mqttAddr:(NSString*)mqttAddr
      httpAddr:(NSString*)httpAddr
      redisAddr:(NSString*)redisAddr
      mediaStore:(NSString*)mediaStore
      gwdevId:(NSString*)gwdevId
      ossSpec:(OssSpec*)ossSpec
      dwAuthSpec:(DwAuthSpec*)dwAuthSpec { 
     self.serviceId = serviceId;               
     self.productKey = productKey;               
     self.productSecret = productSecret;               
     self.protocol = protocol;               
     self.mqttAddr = mqttAddr;               
     self.httpAddr = httpAddr;               
     self.redisAddr = redisAddr;               
     self.mediaStore = mediaStore;               
     self.gwdevId = gwdevId;               
     self.ossSpec = ossSpec;               
     self.dwAuthSpec = dwAuthSpec;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self serviceId])
    {
        [result setValue:[self serviceId] forKey:@"serviceId"];
    }
    if([self productKey])
    {
        [result setValue:[self productKey] forKey:@"productKey"];
    }
    if([self productSecret])
    {
        [result setValue:[self productSecret] forKey:@"productSecret"];
    }
    if([self protocol])
    {
        [result setValue:[self protocol] forKey:@"protocol"];
    }
    if([self mqttAddr])
    {
        [result setValue:[self mqttAddr] forKey:@"mqttAddr"];
    }
    if([self httpAddr])
    {
        [result setValue:[self httpAddr] forKey:@"httpAddr"];
    }
    if([self redisAddr])
    {
        [result setValue:[self redisAddr] forKey:@"redisAddr"];
    }
    if([self mediaStore])
    {
        [result setValue:[self mediaStore] forKey:@"mediaStore"];
    }
    if([self gwdevId])
    {
        [result setValue:[self gwdevId] forKey:@"gwdevId"];
    }
    if([self ossSpec])
    {
        [result setValue:[[self ossSpec] dictionary]forKey:@"ossSpec"];
    }
    if([self dwAuthSpec])
    {
        [result setValue:[[self dwAuthSpec] dictionary]forKey:@"dwAuthSpec"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceId = [dictionary objectForKey:@"serviceId"];
    self.productKey = [dictionary objectForKey:@"productKey"];
    self.productSecret = [dictionary objectForKey:@"productSecret"];
    self.protocol = [dictionary objectForKey:@"protocol"];
    self.mqttAddr = [dictionary objectForKey:@"mqttAddr"];
    self.httpAddr = [dictionary objectForKey:@"httpAddr"];
    self.redisAddr = [dictionary objectForKey:@"redisAddr"];
    self.mediaStore = [dictionary objectForKey:@"mediaStore"];
    self.gwdevId = [dictionary objectForKey:@"gwdevId"];
    self.ossSpec = [[OssSpec alloc]initWithDic:[dictionary objectForKey:@"ossSpec"]];
    self.dwAuthSpec = [[DwAuthSpec alloc]initWithDic:[dictionary objectForKey:@"dwAuthSpec"]];
    return self;
}
 @end
 
 


